﻿
function StoreController($scope, service, $routeParams, $location, $http) {

    //get data of Store list api/storelist/1
    $http.get(service.locationUrl + "/storelist/" + service.infoUser.Id, {})
        .success(function (data) {
            $scope.rowsStoreList = data;
        })
        .error(function (err) {

            console.log("error", err);
        });

    $scope.onEdit = function (id, index, totalStaff)
    {
        var order = index + 1;
        $location.path("/StoreEdit/" + id).search
        ({
            type: 'Edit',
            totalStaff : totalStaff,
            order: order
        });
    }
    $scope.createNew = function ()
    {
        $location.path("/StoreEdit/").search({
            type: 'New',
            companyId: service.infoUser.Id
        });
    }
    
}